package com.yun.zf.common.mapstruct.admin;

import com.yun.zf.common.admin.model.house.*;
import com.yun.zf.common.admin.model.house.es.*;
import com.yun.zf.common.admin.model.search.CommunitySearchMo;
import com.yun.zf.common.admin.model.search.HouseSearchMo;
import com.yun.zf.common.app.domain.*;
import com.yun.zf.common.esIndex.HouseIndexTemplate;
import com.yun.zf.common.esIndex.HouseRentIndexTemplate;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface HouseMapper {
    HouseMapper INSTANCE = Mappers.getMapper(HouseMapper.class);



    HouseIndexTemplate houseInfoToIndex(BasicEs basicEs, DetailEs detailEs, HouseInfoEs infoEs, SaleEs saleEs);

    HouseRentIndexTemplate houseInfoToRentIndex(BasicEs basicEs, DetailEs detailEs, HouseInfoEs infoEs, RentEs rentEs);

    ZfHouseCertificate houseCertMoToCert(HouseCertificateMo houseCertificateMo);

    HouseCertificateMo houseCertToCertMo(ZfHouseCertificate houseCertificate);

    ZfOwnerCertificate certiificateMotoOwner(OwnerCertificateMo certificateMo);

    OwnerCertificateMo certiificateToMo(ZfOwnerCertificate certificate);

    ZfHouseBasic moToHouseBasic(HouseBasicMo houseBasicMo);

    ZfHouseDetail moToHouseDetail(HouseDetailMo detailMo);
    ZfHouseDesc moToHouseDesc(HouseDescMo houseDescMo);

    @Mappings({
            @Mapping(source="infoId", target="id"),
    })
    ZfHouseInfo moToHouseInfo(HouseInfo houseInfo);
    @Mappings({
            @Mapping(source="rentId", target="id"),
    })
    ZfHouseInfoRent moToHouseInfoRent(HouseInfo houseInfo);
    @Mappings({
            @Mapping(source="saleId", target="id"),
    })
    ZfHouseInfoSale moToHouseInfoSale(HouseInfo houseInfo);

    @Mappings({
            @Mapping(source="id", target="infoId"),
    })
    HouseInfo houseInfoToMo(ZfHouseInfo houseInfo);
    @Mappings({
            @Mapping(source="id", target="rentId"),
    })
    HouseInfo houseInfoRentToMo(ZfHouseInfoRent rent);
    @Mappings({
            @Mapping(source="id", target="saleId"),
    })
    HouseInfo houseInfoSaleToMo(ZfHouseInfoSale sale);

    CommunitySearchMo searchHouseToCommunity(HouseSearchMo houseSearchMo);

}
